<admintpl file="header"/>
</head>
<body class="need_breadcrumb_back">
<div class="wrap js-check-wrap">
    {:sp_get_admin_breadcrumb()}
    <form action="{:U('Bunk/add_post')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data">
        <div class="row-fluid mtop20">
            <div class="span7">
                <fieldset class="width80p">
                    <div class="control-group info">
                        <label class="control-label">上级地区</label>
                        <div class="controls">
                            <input type="hidden" name="pid" value="{$parent.bunk_id}">
                            <input type="hidden" name="type" value="{$parent['type']+1}">
                            <input type="text" name="name" value="{$parent.name}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">名称</label>
                        <div class="controls">
                            <input type="text" name="name" value="" placeholder="输入当前级别名称" required>
                            <span class="form-required">*</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">可使用权月</label>
                        <div class="controls">
                            <input type="text" name="totaluse" value="">
                        </div>
                    </div>

                </fieldset>
            </div>
            <div class="span5"></div>
        </div>
        <div class="form-actions">
            <button class="btn btn-primary js-ajax-submit" type="submit"><i class="fa fa-save" aria-hidden="true"></i>{:L("SAVE")}</button>
        </div>
    </form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
    $(function() {
        ajaxFormSubmitInit({
                'name' : {required : 1}
            }, {
                'name' : {required : '请输入地区名称'}
            }, [{
                name : '继续添加？',
                callback : function() {
                    reloadPage(window);
                    return true;
                },
                focus : true
            }, {
                name : '返回列表',
                callback : function() {
                    window.location.href = "{:U('Bunk/index', array('pid' => $parent['bunk_id']))}";
                    return true;
                }
            }
            ]
        );
    });
</script>
</body>
</html>